package cn.flightcloud.boot.commom.listener;

import java.util.Date;

import org.apache.commons.lang3.time.DateFormatUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.boot.context.event.ApplicationStartedEvent;
import org.springframework.context.ApplicationListener;

public class BootListener implements ApplicationListener<ApplicationStartedEvent> {

	private static final Logger LOGGER = LoggerFactory.getLogger(BootListener.class);

	public void onApplicationEvent(ApplicationStartedEvent event) {
		Date date = new Date(event.getTimestamp());
		LOGGER.info("start time：{}", DateFormatUtils.format(date, "yyyy-MM-dd HH:mm:ss"));
	}

}
